package net.cyndeline.temporary

import net.cyndeline.entitySystem.EventSystemSetup
import net.cyndeline.entitySystem.EventSystem
import net.cyndeline.componentSystem.movement.MovementProcessingSystem
import com.escalatesoft.subcut.inject.BindingModule
import com.escalatesoft.subcut.inject.Injectable
import net.cyndeline.entitySystem.EventPriority
import net.cyndeline.componentSystem.gui.ObjectMovedSystem
import net.cyndeline.componentSystem.gameplay.TurnSystem
import net.cyndeline.componentSystem.gameplay.PlayerInputEnablerSystem
import net.cyndeline.componentSystem.movement.MovementObstacleCheckSystem

class TempSystemSetup(implicit val bindingModule: BindingModule) extends EventSystemSetup with Injectable {
  
  override def setup(system: EventSystem) {
    
    /* Essential systems */
    val essentialPrio = EventPriority.PRIORITY_ESSENTIAL
    system.registerEventHandler(new MovementObstacleCheckSystem(), essentialPrio)
    
    /* Normal systems */
    val normalPrio = EventPriority.PRIORITY_NORMAL
    system.registerEventHandler(new MovementProcessingSystem(), normalPrio)
    
    /* Low systems */
    val lowPrio = EventPriority.PRIORITY_LOW
    system.registerEventHandler(new TurnSystem(), lowPrio)
    system.registerEventHandler(new PlayerInputEnablerSystem(), lowPrio)
    
    /* Trivial systems */
    val trivialPrio = EventPriority.PRIORITY_TRIVIAL
    system.registerEventHandler(new ObjectMovedSystem(), trivialPrio)
  }
}